<?php
	include("db.php");

	if(isset($_GET["id"]) && isset($_GET["negatif"])){

		$id = $_GET['id'];
		$negatif = $_GET['negatif'];
		$negatif = $negatif+1;

		try{
			$sql = "UPDATE BITCH
			 SET NEGATIF = $negatif
			 WHERE id=$id";
	        $stmt = $dbh->prepare($sql);
	        $stmt->execute();

	        $sql2 = "SELECT negatif
			 FROM BITCH
			 WHERE id=$id";
	        $stmt = $dbh->prepare($sql2);
	        $stmt->execute();
	        $array = $stmt->fetchAll();

	        echo json_encode($array);
	    }
	    catch(Exception $e){
	        echo "Error GET ALL db";
	    }
	}


	